home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aac.d64
/
pascal-sieve
< prev
next >
Wrap
Text File
|
2007-02-28
|
503b
|
30 lines
(*program sieve test*)
const size=1000;
var flags,iter,count,prime,i,k: integer;
begin
for iter:=1 to 10 do
begin
writeln(' iteration= ',iter);
for i:=0 to size do
begin
flags:=1;
count:=0;
end;
for i:=0 to size do
begin
if flags=1 then
begin
prime:=i+i+3;
k:=i+prime;
while k>=size do
begin
flags:=0;
k:=k+prime;
end;
count:=count+1;
end;
end;
end;
writeln(' prime = ',count);
end.